import '@/plugins/unocss';
import '@/styles/index.less';
import 'vue/jsx';

import { createApp } from 'vue';

import { setupElementPlus } from '@/plugins/elementPlus';
import { setupI18n } from '@/plugins/vueI18n';
import { setupRouter } from '@/router';
import { setupStore } from '@/store';

import App from './App.vue';
import './permission';

const setupAll = async () => {
  // 实例化主程序
  const app = createApp(App);

  await setupI18n(app);

  // 实例化store
  setupStore(app);

  // 挂载ui库
  setupElementPlus(app);

  // 挂载路由
  setupRouter(app);

  // 挂载应用
  app.mount('#app');
};

setupAll();
